<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- 
    v-for
    1) 作用: 基于数据数组去遍历渲染多个dom对象
    2) 语法:
       v-for="(item, index) in 数据数组"
       - item 数组中的每一项
       - index 数组中每一项对应的下标
      
       省略下标的写法
       v-for="item in 数据数组"
   -->
  <div id="app">
    <h3>华仔水果店</h3>
    <ul>
      <li v-for="(item, index) in list">
        {{ item }} ---- {{ index }}
      </li>
    </ul>
    <p>--------------------------</p>
    <ul>
      <li v-for="item in list">
        {{ item }}
      </li>
    </ul>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        list: ['苹果', '西瓜', '蓝莓', '榴莲', '橘子']
      }
    })
  </script>
</body>

</html>